function doit(n) {
    var d = [];
    for (var i = 1; i < n; i++)
        d.push({
            name: "shen" + i,
            sex: i % 3 == 0 ? "男" : '女',
            age: i,
            address: "address" + (i * i)
        });
    var t = new Date();
    $("#t1").autoTable({
        data: d,
        header: [
            [
                { title: "姓名|name", span: [1, 1] },
                { title: "性别|sex", span: [1, 1] },
                { title: "年龄|age", span: [1, 1] },
                { title: "地址", span: [2, 1] }
            ]],
        headerFields: ["name", "sex", "age", "address"],
        header2: [
            [
                { title: "姓名|name", span: [1, 1] },
                { title: "性别|sex", span: [1, 1] },
                { title: "年龄|age", span: [1, 1] },
                { title: "地址", span: [2, 1] }
            ]],
        header2Fields: ["name", "sex", "age", "address"],
        sortFields: ["age"],
        editUrl: 'aaa.ashx',
        editTable: 'tttt',
        editKeyFields: ["name"],
        editFields: ["age", "address"],
        isScrollable: true,
        freezeContainer: '#wrap',
        freezeFields: ["name"],
        keydataOnRow: ["name", "sex"],
        tooltipOnRow: function (row) { return row.name; },
        isPageable: true,
        isSelectable: true,
        isSaveable: true,
        columnsWidths: [100, 100, 100, 100]
    });
    /* $("#t2").autoTable({
         data:d,
        header:[
             [
             {title:"姓名|name",span:[1,1]},
             {title:"性别|sex",span:[1,1]},
             {title:"年龄|age",span:[1,1]},
             {title:"地址",span:[2,1]}
         ]] ,
         sortFields:["age"],
         editUrl: 'aaa.ashx',
         editTable: 'tttt',
         editKeyFields: ["name"],
         editFields: ["age","address"],
         isScrollable:true,
         freezeContainer:'#wrap1',
         freezeFields:["name"],
         keydataOnRow:["name","sex"],
         tooltipOnRow:function(row){return row.name;},
         isPageable:true,
         isSelectable:true  ,
         columnsWidths:[150,150,150,150],
         initClass: "table table-striped table-condensed table-hover"
     });*/
    console.log('渲染' + n + '行，需要' + (new Date().valueOf() - t.valueOf()) / 1000);
}
$(document).dblclick(function () {
    doit(parseInt($(".num").val()));
    // 
    // $("table").on("afterCellEdited",function(a,b,c,d){
    //         
    //     console.log(a)
    // })
    // $("#a").tabpanel();
    // $("#a").tabpanel("add",{
    //     id:"shen",
    //     title:"titileshen",
    //     url:"index.html"
    // })
});
